/*
============================================================================
 Name        : MyMenuBar.cpp
 Author      : 
 Copyright   : Your copyright notice
 Description : Application view implementation
============================================================================
*/

// INCLUDE FILES
#include <coemain.h>
#include "CPainter.h"
#include "TestMe2AppView.h"
#include "WaittingBar.h"
#include <EIKENV.H>
// ============================ MEMBER FUNCTIONS ===============================

// -----------------------------------------------------------------------------
// MyMenuBar::NewL()
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
MyMenuBar* MyMenuBar::NewL( CPainter* aPainter, const TRect& aRect )
    {
    MyMenuBar* self = MyMenuBar::NewLC( aPainter, aRect );
    CleanupStack::Pop( self );
    return self;
    }

// -----------------------------------------------------------------------------
// MyMenuBar::NewLC()
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
MyMenuBar* MyMenuBar::NewLC( CPainter* aPainter, const TRect& aRect )
    {
    MyMenuBar* self = new ( ELeave ) MyMenuBar(aPainter);
    CleanupStack::PushL( self );
    self->ConstructL( aPainter, aRect );
    return self;
    }

// -----------------------------------------------------------------------------
// CTestMe2AppView::ConstructL()
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void MyMenuBar::ConstructL( CPainter* aPainter, const TRect& aRect )
    {
    // Create a window for this application view
    CreateWindowL();

    // Set the windows size
    SetRect( aRect );

	TRect rc(10,0,200,27); 
	rc.Move(aRect.iTl);   
//	iWaittingBar = CWaittingBar::NewL( aPainter, rc );
//	iWaittingBar->SimpleWait();
    // Activate the window, which makes it ready to be drawn
    ActivateL();
    }

// -----------------------------------------------------------------------------
// MyMenuBar::MyMenuBar()
// C++ default constructor can NOT contain any code, that might leave.
// -----------------------------------------------------------------------------
//
MyMenuBar::MyMenuBar(CPainter* aPainter)
    {
    // No implementation required
    iPainter = aPainter;
    }


// -----------------------------------------------------------------------------
// MyMenuBar::~MyMenuBar()
// Destructor.
// -----------------------------------------------------------------------------
//
MyMenuBar::~MyMenuBar()
    {
    // No implementation required
    delete iWaittingBar;
    }


// -----------------------------------------------------------------------------
// MyMenuBar::Draw()
// Draws the display.
// -----------------------------------------------------------------------------
//
TRgb rgb(165,174,255);
void MyMenuBar::Draw( const TRect& aRect ) const
    {
     // Get the standard graphics context
    CWindowGc& gc = SystemGc();

	gc.SetPenColor	(TRgb(0,0,255));
	gc.SetBrushColor(rgb);	
    // Gets the control's extent
    TRect drawRect( Rect());
    // Clears the screen
    gc.Clear( drawRect );

	TRect rc(aRect);
	iPainter->Draw(gc, rc);    

  	}

// -----------------------------------------------------------------------------
// MyMenuBar::SizeChanged()
// Called by framework when the view size is changed.
// -----------------------------------------------------------------------------
//
void MyMenuBar::SizeChanged()
    {  
    DrawNow();
    }
    
void MyMenuBar::TestMe()
{
	rgb = TRgb(16,174,255);	
	DrawNow();
	//CEikonEnv::Static()->InfoMsg(_L("ggg"));
}
// End of File
